<?php namespace Home\Controller;
use	Hdphp\Controller\Controller;
class ContentController extends Controller{
	public function index(){
		$aid=Q('get.aid',0,'intval');
//		关联表，获得分类标签等信息
		$arcModel=new \Common\Model\Arc;
		$arcModel->where("aid={$aid}")->increment('click',1);
		$data=(new \Common\Model\Arc)->join('article_data','article_aid','=','aid')->where('aid='.$aid)->find();
//		获得对应aid的标签
		$arctag=new \Common\Model\ArcTag;
		$data['tag']=$arctag->join('tag','tag_tid','=','tid')->where('article_aid='.$aid)->field('tid,tname')->get();
		
//		分配数据
		$about=$arcModel->where('is_recycle=0')->orderby('sendtime','asc')->limit(5)->get();
			//		按照点击的次数进行排序获得数据	
		$arcModel=new  \Common\Model\Arc;
		$click=$arcModel->where('is_recycle=0')->orderby('click','desc')->limit(3)->get(); 
		$click2=$arcModel->where('is_recycle=0')->orderby('click','desc')->limit(3,5)->get();
		View::with('click2',$click2);
		View::with('click',$click);
//		按照 推荐的标签筛选
		$tui=$arcModel->join('article_tag','article_aid','=','aid')->where('is_recycle=0 AND tag_tid=5')->get();
		View::with('tui',$tui);

		View::with('about',$about);
		View::with('data',$data);
		View::make();
	}
	
}

 ?>